package pdai.a1_2泛型;



public class Notepad<K, V> {
    private K key;
    private V value;

    public K getKey() {
        return key;
    }

    public void setKey(K key) {
        this.key = key;
    }

    public V getValue() {
        return value;
    }

    public void setValue(V value) {
        this.value = value;
    }

    public static void main(String[] args) {
        Notepad<String,Integer> notepad=new Notepad<>();
        notepad.setKey("lyx");
        notepad.setValue(25);
        System.out.println("姓名:"+notepad.getKey());
        System.out.println("年龄:"+notepad.getValue());
    }
}
